#! php
<?php
include "./vendor/autoload.php";
$s = $argv;

$controller = isset($s[1])?ucfirst($s[1]):'Index';
$action = isset($s[2])?$s[2]:'index';

$psid = isset($s[2])?$s[2]:1;

$_SESSION['psid'] = $psid;

$class = "\\app\\console\\{$controller}";

if(!class_exists($class)){
    exit("Controller 不存在");
}
$app  = new $class();
if(!method_exists($app,$action)){
    exit("method 不存在");
}

$app->$action();
